package com.wang.lottery.infrastucture.mapper;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wang.lottery.domain.activity.model.po.UserTakeActivity;
import com.wang.lottery.domain.activity.model.po.UserTakeActivityCount;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author wjh
 * @create 2023-11-08 18:27
 * 用户活动参与次数表Mapper
 */
@Mapper
public interface UserTakeActivityCountMapper extends BaseMapper<UserTakeActivityCount> {
    /**
     * 查询用户领取次数信息
     * @param uId  请求入参【活动号、用户ID】
     * @return 领取结果
     */
    @DBRouter
    UserTakeActivityCount queryUserTakeActivityCount(String uId,Long activityId);

    /**
     * 插入领取次数信息
     *
     * @param userTakeActivityCount 请求入参
     * @return
     */
//    @DBRouter
    int insert(UserTakeActivityCount userTakeActivityCount);

    /**
     * 更新领取次数信息
     * @param userTakeActivityCount 请求入参
     * @return 更新数量
     */
//    @DBRouter
    int updateLeftCount(UserTakeActivityCount userTakeActivityCount);

    int lockTackActivit(UserTakeActivity userTakeActivity);
}
